package com.atcc.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.atcc.demo.domain.TestInterceptor;


@Configuration
public class InterceptorConfig implements WebMvcConfigurer{
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(testInterceptor())
		        .addPathPatterns("/**")
		        .excludePathPatterns("/test/login/**");
	}
	
	@Bean
	public TestInterceptor testInterceptor() {
		return new TestInterceptor();
	}
}
